< previous page page_894 next page >

Page 894
The last routine called from SQLFileProcess handles the execution of SQL statements. Create a Public Sub called SQLDoCommand and enter the code in Listing A.22.
Type.gifListing A.22. Coding the SQLDoCommand routine.
Sub SQLFileProcess()
   '
   ' main loop for processing ASCII file lines
   '
   On Error GoTo SQLFileProcessErr
   '
   Dim cToken As String
   '
   If intSQLFlag = False Then
      GoTo SQLFileProcessExit
   End If
   '
   strSQLLine = ""
   While Not EOF(intSQLFileHandle)
      If intGlobalErr = True Then
         GoTo SQLFileProcessExit
      End If
      '
      Line Input #intSQLFileHandle, strLine
      intLine = intLine + 1
      strLine = Trim(strLine) + " "
      If Len(strLine) <> 0 Then
         cToken = GetToken(strLine)
         If Right(cToken, 1) = ";" Then
            cToken = Left(cToken, Len(cToken) - 1)
         End If
         '
         SQLVBMain.lblProgress.Caption = strLine
         DoEvents
         Select Case UCase(cToken)
            Case Is = "//"
               ' no action - comment line
            Case Is = "DBCONNECT"
                SQLdbConnect
            Case Is = "DBVERSION"
                SQLdbVersion
            Case Is = "DBOPEN"
               SQLdbOpen
            Case Is = "DBMAKE"
               SQLdbMake
            Case Is = "DBCLOSE"
               SQLdbClose
            Case Is = "DBQUIET"
               SQLQuietFlag
            Case Else
               strSQLLine = strSQLLine + strLine
               If Right(strLine, 2) = "; " Then
                  SQLDoCommand
                  strSQLLine = ""

 
< previous page page_894 next page >

If you like this book, buy it!